<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VUE学习 - 2.2-条件渲染</title>
</head>

<body>


    <!--载入vue.js-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="Application">
        <!--分数查询-->
        <input v-model="achievement" type="text">
        <button @click="query">真/假</button>

        <div v-if="show">
            <h1 v-if="achievement == 100">满分</h1>
            <h1 v-else-if="achievement > 60">及格</h1>
            <h1 v-else>不及格</h1>
        </div>



    </div>


    <script>
        const App = {
            data() {
                return {
                    show: false,
                    achievement: "",
                }
            },

            methods: {
                query() {
                    if (this.show) {
                        this.show = false
                    } else {
                        this.show = true
                    }
                },



            }
        }
        Vue.createApp(App).mount("#Application")

    </script>

    <style>

    </style>


</body>

</html>